import grpc
from RPC.grpc.grpc_hello.proto import helloworld_pb2, helloworld_pb2_grpc

if __name__ == '__main__':
    # 连接服务端
    with grpc.insecure_channel("localhost:8080") as channel:
        stub = helloworld_pb2_grpc.GreeterStub(channel)
        rsp: helloworld_pb2.HelloReply = stub.SayHello(helloworld_pb2.HelloRequest(name="hello world666"))
        print(rsp.message)